package com.yjz.jvm.java8.optional;

import java.util.Optional;

public class Outer {
  Nested nested;

  Nested getNested() {
    return nested;
  }

  public static void main(String[] args) {
    Outer  outer=null;
//    System.out.println(Optional.of(outer).map(Outer::getNested).map(Nested::getInner).map(Inner::getFoo).ifPresent(s -> );
  }
}

class Nested {
  Inner inner;

  Inner getInner() {
    return inner;
  }
}

class Inner {
  String foo;

  String getFoo() {
    return foo;
  }
}